<template>

	<view class="content">

	
	<view style="width: 100%;height: 1upx;background-color: #eeeeee;"></view>
	
	
	<view class='cellOneLine' >
	
		<view class='iconleftHint' @click="showDetail">{{showAll==1?"-":"+"}}</view>
	
		<view class='contentText1'>{{userinfo.nickname}}</view>
		
		
		<view class='contentText1' style="margin-left: 20upx;">用户等级：</view>
		
		<view class='contentText2'>{{userinfo.grade_name}}</view>
		
		<view class='contentText2' style="margin-left: 10upx;">{{userinfo.vip_grade_name}}</view>
		
		
		<view class='contentText1' style="margin-left: 20upx;">粉丝数：</view>
		
		<view class='contentText2'>{{fansList.length}}</view>
	
	</view>
	
	
	<!-- <view style="width: 100%;height: 1upx;background-color: #eeeeee;"></view> -->
	
	
	
	<view v-for="(item, index) in fansList" :key="index" v-if="showAll==1">
		
	<view style="width: 100%;height: 2upx;background-color: #eeeeee;"></view>
	
		
	
	<view class='cellOneLine'>
		
	
	<view class='iconleftHint'style="margin-left: 60upx;">+</view>
		
		<view class='contentText1'>{{item.nickname}}</view>
		
		<view class='contentText1' style="margin-left: 30upx;">用户等级：</view>
		
		<view class='contentText2'>{{item.grade_name}}</view>
		
		<view class='contentText2' style="margin-left: 10upx;">{{item.vip_grade_name}}</view>
		
		
		<view class='contentText1' style="margin-left: 30upx;">创建时间：</view>
		
		<view class='contentText2'>{{item.ctime.substr(0,11)}}</view>
	
	</view>
	

	</view>


	<view style="width: 100%;height: 2upx;background-color: #eeeeee;"></view>
	
		


	</view>
</template>


<script>
	const delay = (function() {
		let timer = 0
		return function(callback, ms) {
			clearTimeout(timer)
			timer = setTimeout(callback, ms)
		}
	})()

	import {
		isMemberWeb
	} from '@/config/config.js'
	import jihaiCopyright from '@/components/jihai-copyright/jihaiCopyright.vue'
	import {
		checkLogin
	} from '@/config/mixins.js'
	export default {
		components: {
			jihaiCopyright
		},

		mixins: [checkLogin],
		data() {
			return {
				userinfo: '',
				
				fansList : '',
				
				showAll : 1 ,

			}
		},
		onShow() {


			if (!this.$db.get('userToken') && isMemberWeb) {



				this.checkIsLogin()
		
				return



			}


			this.initData()
		},
		methods: {

			showDetail(){
				
				if (this.showAll==1){
					this.showAll =0 ;
				}else{
					this.showAll =1 ;
				}
				
				// console.log(123);
			},



			goLogin() {
				uni.navigateTo({
					url: '/pages/login/choose/index'
				})
			},


			initData() {
				// 获取用户信息
				
				// recomment
				
				// userInfo
				
				// recomment
					
					// userInfo
					
					
					
					
					
		
						
				this.$api.userInfo( {}, res => {
					if (res.status) {
				
						console.log(res.data);
						
						this.userinfo = res.data;
				
				
					}
				})
						
						
						
				
				
				
				let userToken = this.$db.get("userToken");
				
				var data = {
					limit:1000,
					// token : userToken,
					page : 1
				}
			
			console.log(data);
		
			this.$api.recommend( data, res => {
				if (res.status) {
			
					console.log(res.data);
					
					this.fansList = res.data;
			
			
				}
			})
		
		
		
			},



		},
		computed: {

		},
		watch: {}
	}
</script>

<style lang="scss" scoped>
	
	page{
		background-color: #FFFFFF;
	}
	


	.cellOneLine {

		width: 100%;

		height: 90upx;

		display: flex;
		


		flex-direction: row;

		// justify-content: space-between;
		
		// background-color: #eeeeee;
		
		align-items: center;


	}




	.iconleftHint {

		height: 40upx;
		
		width: 40upx;

		line-height: 30upx;
		
		
		
		text-align: center;
		
		font-weight: blod;


		margin-left: 30upx;
		
		font-size: 40upx;

		color: #666666;
		
		border-radius: 10upx;
		
		border-color: #666666;
		
		border-width: 4upx;
		
		
		
		border-style: solid;



		// background-color: #007AFF;


	}
	
	
	.contentText1{
		
		
		margin-left: 20upx;
		
		// background-color: #007AFF;

		font-size: 26upx;
		
		color: #666666;

		
		
	}


	.contentText2{
		
		
		// margin-left: 20upx;
		

		font-size: 26upx;
		
		color: red;

		
		
	}




</style>
